import 'package:casdon/modules/me/data/api/user_center_api.dart';

class UserCenterModel {
  final int followTotal;
  final int fansTotal;
  final int topicTotal;
  final bool? isFollow;

  UserCenterModel({
    required this.followTotal,
    required this.fansTotal,
    required this.topicTotal,
    this.isFollow,
  });

  // 静态方法转换
  static UserCenterModel fromApi(ResponseUserCenterApi response) {
    return UserCenterModel(
      followTotal: response.followTotal,
      fansTotal: response.fansTotal,
      topicTotal: response.topicTotal,
      isFollow: response.isFollow,
    );
  }

  factory UserCenterModel.initial() =>
      UserCenterModel(fansTotal: 0, followTotal: 0, topicTotal: 0);
}
